﻿using System.Data;
using Microsoft.EntityFrameworkCore;
using Abp.Zero.EntityFrameworkCore;
using MPICore.Authorization.Roles;
using MPICore.Authorization.Users;
using MPICore.MultiTenancy;
using MPICore.PhoneBook.Person;
using MPICore.PhoneBook.PhoneNumber;

namespace MPICore.EntityFrameworkCore
{
    public class MPICoreDbContext : AbpZeroDbContext<Tenant, Role, User, MPICoreDbContext>
    {
        /* Define a DbSet for each entity of the application */
        
        
        public MPICoreDbContext(DbContextOptions<MPICoreDbContext> options)
            : base(options)
        {
        }
        public DbSet<Person> Persons { set; get; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Person>().ToTable("Person", "PB");
            modelBuilder.Entity<PhoneNumber>().ToTable("PhoneNumber", "PB");
            base.OnModelCreating(modelBuilder);
        }
    }
}
